#define _CRT_SECURE_NO_WARNINGS 1
int dominantIndex(int* nums, int numsSize) {
	if (numsSize == 1) {
		return 0;
	}
	else {
		int max = 0;
		int set = 0;
		for (int i = 0; i < numsSize; i++) {
			if (max < nums[i]) {
				max = nums[i];
				set = i;
			}
		}
		for (int j = 0; j < numsSize; j++) {
			if (max < 2 * nums[j] && nums[j] != max)
				return -1;
		}
		return set;
	}
}